//
//  DrayImage.m
//  AirQuality
//
//  Created by Mac on 15/12/29.
//  Copyright © 2015年 Po. All rights reserved.
//

#import "DrayImage.h"

@implementation DrayImage


- (void)drawRect:(CGRect)rect
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextBeginPath(context);
    CGContextSetLineWidth(context, 0.2);
    CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
    CGContextSetFillColorWithColor(context, SysMainColor.CGColor);
    CGContextMoveToPoint(context,0,20);//设置起点
    CGContextAddLineToPoint(context,15, 20);
    CGContextAddLineToPoint(context,7.5, 0);
    CGContextClosePath(context);
    [SysMainColor setFill];
    CGContextDrawPath(context,kCGPathFillStroke);
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self drawImageWithArr];
    }
    return self;
}

- (void)drawImageWithArr
{
    
//    CGPoint sPoints[3];//坐标点
//    sPoints[0] =CGPointMake(10,10);//坐标1
//    sPoints[1] =CGPointMake(0, 30);//坐标2
//    sPoints[2] =CGPointMake(20, 20);//坐标3
//    CGContextAddLines(context, sPoints, 3);//添加线
    
}

@end
